<?php include "header.html"; ?>

<div id="main">
<?php if($ts == 'list'){ ?>
<h3>话题列表</h3>
<table cellpadding="0" cellspacing="0">
<tr>
<td>ID</td><td>词条</td><td>时间</td><td>设置</td><td>管理</td>
</tr>

<?php foreach($cates as $key=>$cate){ ?>
<tr  class='odd'><td><?php echo $cate['id']; ?></td><td><?php echo $cate['cname']; ?></td><td><?php echo date('Y-m-d H:i:s',$cate['cTime']) ?></td><td><?php if($cate['cset'] == 0){echo '默认';}elseif($cate['cset'] == 1){echo '今天';}elseif($cate['cset'] == 2){echo '本周';}elseif($cate['cset'] == 3){echo '站内';}elseif($cate['cset'] == 4){echo '推荐';} ?>
</td><td  class='action'><a href="../topic.php?id=<?php echo $cate['id'];  ?>"  target="_blank" class='view'>查看</a> <a href="index.php?action=cate&ts=edit&id=<?php echo $cate['id']; ?>" class='edit'>编辑</a> <a href="index.php?action=cate&ts=del&id=<?php echo $cate['id']; ?>">删除</a></td>
</tr>
<?php } ?>

</table>
<div class="manu">
<?php echo $page_url; ?>
</div> 
<?php } ?>

<?php if($ts == 'add'){ ?>
<h3>添加话题</h3>
<fieldset>
<form method="POST"  class="jNice" action="index.php?action=cate&ts=add">
<p><label>例如：世博会</label><input type="text" class="text-long" name="cname" /></p>
<input type="submit" value="添加话题" name="" />
</form>
</fieldset>
<?php } ?>

<?php if($ts == 'edit'){ ?>
<h3>编辑话题</h3>
<fieldset>
<form method="POST"  class="jNice" action="index.php?action=cate&ts=update&id=<?php echo $_GET['id']; ?>">
<p><label>例如：世博会</label><input type="text" class="text-long" name="cname" value="<?php echo $cateDate['cname']; ?>" /></p>
<p><label>设置：</label><select name="cset"><option value="0">默认</option><option value="1">今日</option><option value="2">本周</option><option value="3">官方</option><option value="4">推荐</option></select></p>
<input type="submit" value="修改话题" name="" />
</form>
</fieldset>
<?php } ?>

</div>

<?php include "footer.html"; ?>